The present invention relates to computer systems having removable hard drives, and more particularly to a system and method for preventing an operating system from accessing a hard drive which is different than the hard drive used to boot the system.
It is sometimes desirable for two or more users to be able to share a single computer system. One feature that facilitates the sharing of a computer system is a removable hard drive. A computer system with a removable hard drive allows a plurality of users to each have a separate hard drive with the respective user""s applications and data. In this manner, multiple users each having their own drives can effectively share a single computer system. A removable hard drive also allows a single user to store a greater number of applications and data for use in the computer system than would otherwise be available with a single non-removable hard drive. For example, the user can maintain two or more hard drives which each contain desired applications, and the user can insert the respective hard drive into the computer system depending upon the desired application or data desired to be accessed.
In computer systems with a removable hard drive, the computer system can be booted with a respective hard drive, and the hard drive can typically be removed and then later reinserted while the operating system is still active. With some operating systems, the hard drive used to boot the computer system can be removed and a new drive reinserted while the operating system is still active. However, in other operating systems, such as the DOS and Windows operating systems, the primary boot drive cannot be replaced with a new drive while the operating system is still active. In other words, the DOS and Windows operating systems have limited mechanisms for having their primary boot drive replaced while they are active. In general, if the primary hard drive is changed to a different drive while these operating systems are active, these operating systems typically write invalid data to the new drive, resulting in probable erroneous operation.
Some operating systems include the ability to read and verify that a new drive placed in the computer system while the operating system is still active is not a different drive than the one used to boot the system. For example, the operating systems R2 X2 and R-DOS read and verify the user changeable volume ID which is recorded on the hard drive. However, this method is flawed because a computer user can assign the same volume ID to multiple different drives. Thus, if the primary boot drive having a first volume ID was removed and a second different hard drive with the same volume ID was inserted into the computer system, the operating system would erroneously conclude that the same drive was reinserted and would write data to the drive accordingly, resulting in probable erroneous operation. Other operating systems such as UNIX include a mount and unmount mechanism to ensure that the boot drive is the drive reinserted into the computer system. However, this mechanism requires human interaction and is therefore subject to failure.
Therefore, an improved system and method is desired for ensuring that a drive that is inserted into the computer system is the hard drive used to boot the computer system and thus is the drive expected by the operating system.
The present invention comprises a system and method for maintaining data integrity in computer systems which have removable hard drives. The system and method of the present invention ensures that a disk drive which is inserted into the computer system while the operating system is active is the drive used to boot the operating system. The present invention can be used for removable hard drives of various types, including removable PCMCIA drives.
When the computer system boots, system management mode (SMM) software is invoked which powers on the hard drive and reads unique drive identification information from the hard drive. In the preferred embodiment, IDE (Integrated Drive Electronics) drives are used, and these drives include drive identification information which comprises a unique manufacture identification and a drive serial number. This information is read and stored in memory for later use. Later, portions of the computer system may be powered down or the system may be placed in a suspend state. This can occur either under user control or through power management software operating in the computer system. When the hard drive is powered down and/or the computer system is in a suspend state, the hard drive can be removed and later reinserted.
When the computer system resumes from a power down or suspend state and first requires access to the hard drive, the system management mode (SMM) software is again invoked, preferably through I/O port trapping. The SMM software powers on the hard drive and reads the drive identification information from the drive. The SMM software then compares the drive identification obtained from the drive with the drive identification information stored in memory at boot time. If the two sets of identification information are identical, then the SMM software returns control to the native operating system and allows access to the drive. In this case, since the drive identification information obtained after the computer system resumes is identical to the drive identification information saved at boot time, the same drive is comprised in or has been reinserted in the computer system, and thus operation can proceed. If the two sets of drive identification are not identical, then the SMM software powers off the drive and reports to the user that the drive installed in the computer system is not the expected drive, i.e., is not the drive used to boot the system. The SMM software then waits for confirmation that the drive has been changed. When a new drive is inserted, the SMM software repeats the above steps of powering on the hard drive, reading the obtained drive information and comparing the drive identification with the drive identification information stored at boot time. This operation repeats until the correct drive, i.e., the drive used to boot the system, is inserted into the computer system.
Therefore, the invention comprises a system and method for ensuring that a drive different than the hard drive used to boot the system is not inserted into the system while the system is running. The system and method of the present invention thus ensures data integrity in computer systems having removable hard drives. The present invention is also independent of operating system and thus can be used in varying platforms.